﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Quester.Models
{
    public class QuestionVModel
    {
        [Required]
        [HiddenInput(DisplayValue = false)]
        public Guid QuestionID { get; set; }

        [Required]
        [HiddenInput(DisplayValue = false)]
        public Guid TestID { get; set; }

        [Required]
        [Display(Name="Запитання")]
        public string QuestionStr { get; set; }

        [Required]
        public List<AnswerVModel> Answers { get; set; }

        public QuestionVModel()
        {
            Answers = new List<AnswerVModel>();
            for (int i = 0; i < 10; i++)
            {
                Answers.Add(new AnswerVModel() { Answer = String.Empty, AnswerID = Guid.NewGuid(), IsRight = false});
            }
        }
    }
}